package cn.genmer.test.security;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class SalaryCalculation {

    @Test
    public void calcTest(){
        generator(16,21,7200);
        calc(16,21,5664);
    }


    private double calc(double dayCount, double fullFrequentlyDays, double realWages){
        double trialPeriod =  realWages/(dayCount/fullFrequentlyDays);
        double official = trialPeriod/8*10;
        System.out.println(String.format("试用期%s, 转正后%s", trialPeriod-430-400, official-430-400));
        return official;
    }

    private double generator(double dayCount, double fullFrequentlyDays, double grossSalary){
        double trialPeriod =  (grossSalary-400)*(dayCount/fullFrequentlyDays);
        double official = trialPeriod/8*10;
        System.out.println(String.format("试用期%s, 转正后%s", trialPeriod-430-400, official-430-400));
        return trialPeriod-430;
    }
}
